<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <!-- 一个属性绑定把data对象的数据显示在页面上，一个事件函数把修改的值赋给data对象中的属性 -->
        <input type="text" :value="msg" @input='handle'>
        <input type="text" :value="msg" @input='msg=$event.target.value'>
        <span v-text='msg'></span>
    </div>
    <script src="../js/vue.js"></script>
    <script>
        var vm = new Vue({
            el: '#app',
            data: {
                msg: 'hello',
            },
            methods: {
                handle: function (event) {
                    this.msg = event.target.value;
                }
            },
        })
    </script>
</body>

</html>